package com.ocean.recommendationserver.realtimerecommend.crawl;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PatternUtil {
	public static String match(String text,String regex,int find,int group){
		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(text);
		if(find<=0){
			return null;
		}
		while(find>0){
			if(!matcher.find()){
				return null;
			}
			find--;
		}
		return matcher.group(group);
		
	}
}
